﻿@model AddMessageModel2
<div class="row">
    <div class="col-md-12">
        <!-- BEGIN VALIDATION STATES-->
        <div class="portlet box green">
            <div class="portlet-title">
                <div class="caption">
                    <i class="fa fa-reorder"></i>@ViewBag.TableTitle
                </div>
                <div class="tools">
                </div>
            </div>
            <div class="portlet-body form">
                <div class="portlet-body">
                    <ul class="nav nav-tabs">
                        <li class="active" data-url="@Url.Action("AddMessage2", null, null, "http")">
                            <a data-toggle="tab">發送推送消息</a>
                        </li>
                        <li class="" data-url="@Url.Action("AddProject2", null, null, "http")">
                            <a data-toggle="tab">添加項目信息</a>
                        </li>
                    </ul>
                    <div class="tab-content">
                        <div class="tab-pane fade active in" id="tab_1_1">
                            <!-- BEGIN FORM-->
                            @using (Html.BeginForm(null, null, null, FormMethod.Post, new
                            {
                                @class = "form-horizontal",
                                @novalidate = "novalidate",
                                @enctype = "multipart/form-data"
                            }))
                            {
                                <div class="form-body">
                                    @Html.AntiForgeryToken()
                                    @Html.Partial("_Tip")

                                    <div class="form-group">
                                        <label class="control-label col-md-3">
                                            @Html.LabelFor(s => s.appname)
                                        </label>
                                        <div class="col-md-4">
                                            @Html.TextBoxFor(s => s.appname, new { @class = "form-control" })
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3">
                                            @Html.LabelFor(s => s.message)
                                        </label>
                                        <div class="col-md-4">
                                            @Html.TextBoxFor(s => s.message, new { @class = "form-control" })
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3">
                                            @Html.LabelFor(s => s.data)
                                        </label>
                                        <div class="col-md-6">
                                            @Html.TextAreaFor(s => s.data, new { @class = "form-control", @rows = "6" })
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3">
                                            @Html.LabelFor(s => s.aztokenList)
                                        </label>
                                        <div class="col-md-6">
                                            @Html.TextAreaFor(s => s.aztokenList, new { @class = "form-control", @rows = "6" })
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3">
                                            @Html.LabelFor(s => s.IosList)
                                        </label>
                                        <div class="col-md-6">
                                            @Html.TextAreaFor(s => s.IosList, new { @class = "form-control", @rows = "6" })
                                        </div>
                                    </div>
                                </div>
                                <div class="form-actions fluid">
                                    <div class="col-md-offset-3 col-md-9">
                                        <button type="submit" class="btn green">Submit</button>
                                    </div>
                                </div>
                            }
                            <!-- END FORM-->

                        </div>
                    </div>
                </div>
            </div>
            <!-- END VALIDATION STATES-->
        </div>
    </div>
</div>

@section script{
    <script>
        $(function () {
            FormComponents.init();
            $('.nav.nav-tabs li')
                .each(function (i, e) {
                    $(e)
                        .on('click',
                            function () {
                                var url = $(this).attr('data-url');

                                //居然還需要轉化后才能對比
                                if (!!url && location.href.toLowerCase() != url.toLowerCase())
                                    location.href = url;
                            });
                });
        })
    </script>
}